package com.trickytriads.events
{
	import com.trickytriads.model.PlayerData;
	
	import flash.events.Event;

	/**
	 * Event dispatched when requesting or receiving a player's data.
	 */
	public class GetPlayerDataEvent extends Event
	{
		public static const GETPLAYERDATA_REQUEST:String = "getPlayerDataRequest";
		public static const GETPLAYERDATA_DONE:String = "getPlayerDataDone";
		
		// The player ID to request, if we're dealing with a request
		public var _player_id:int;
		// PlayerData, if we're dealing with a "done" type
		public var _pdata:PlayerData;
		// Optional result handler for GETPLAYERDATA_REQUEST types
		public var _resultHandler:Function;
		
		public function GetPlayerDataEvent(type:String, in_player_id:int=-1, in_pdata:PlayerData=null, in_resultHandler:Function=null)
		{
			super(type, false, false);
			this._player_id = in_player_id;
			this._pdata = in_pdata;
			this._resultHandler = in_resultHandler;
		}
		
	}
}